#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 2e5 + 7;
const int M = 1e9 + 7;

int n, h[N];

int main()
{
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    int t;
    cin >> t;
    while (t--)
    {
        cin >> n;
        for (int i = 0; i < n; i++)
            cin >> h[i];
        sort(h, h + n);
        int m = INT_MAX, p = -1;

        for (int i = 1; i < n; i++)
        {
            if (h[i] - h[i - 1] < m)
            {
                m = h[i] - h[i - 1];
                p = i;
            }
        }

        if (n == 2) {
            cout << h[0] << ' ' << h[1] << endl;
            continue;
        }
        for (int i = p; i < n; i++)
        {
            cout << h[i] << ' ';
        }
        for (int i = 0; i < p; i++)
        {
            cout << h[i] << ' ';
        }
        cout << endl;
    }
    return 0;
}